package com.ruoyi.OutboundManagement.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.OutboundManagement.mapper.ReturnOutboundMapper;
import com.ruoyi.OutboundManagement.domain.ReturnOutbound;
import com.ruoyi.OutboundManagement.service.IReturnOutboundService;

/**
 * 退货出库管理Service业务层处理
 * 
 * @author admin
 * @date 2024-07-04
 */
@Service
public class ReturnOutboundServiceImpl implements IReturnOutboundService 
{
    @Autowired
    private ReturnOutboundMapper returnOutboundMapper;

    /**
     * 查询退货出库管理
     * 
     * @param returnId 退货出库管理主键
     * @return 退货出库管理
     */
    @Override
    public ReturnOutbound selectReturnOutboundByReturnId(Long returnId)
    {
        return returnOutboundMapper.selectReturnOutboundByReturnId(returnId);
    }

    /**
     * 查询退货出库管理列表
     * 
     * @param returnOutbound 退货出库管理
     * @return 退货出库管理
     */
    @Override
    public List<ReturnOutbound> selectReturnOutboundList(ReturnOutbound returnOutbound)
    {
        return returnOutboundMapper.selectReturnOutboundList(returnOutbound);
    }

    /**
     * 新增退货出库管理
     * 
     * @param returnOutbound 退货出库管理
     * @return 结果
     */
    @Override
    public int insertReturnOutbound(ReturnOutbound returnOutbound)
    {
        returnOutbound.setCreatedAt(new Date());
        return returnOutboundMapper.insertReturnOutbound(returnOutbound);
    }

    /**
     * 修改退货出库管理
     * 
     * @param returnOutbound 退货出库管理
     * @return 结果
     */
    @Override
    public int updateReturnOutbound(ReturnOutbound returnOutbound)
    {
        return returnOutboundMapper.updateReturnOutbound(returnOutbound);
    }

    /**
     * 批量删除退货出库管理
     * 
     * @param returnIds 需要删除的退货出库管理主键
     * @return 结果
     */
    @Override
    public int deleteReturnOutboundByReturnIds(Long[] returnIds)
    {
        return returnOutboundMapper.deleteReturnOutboundByReturnIds(returnIds);
    }

    /**
     * 删除退货出库管理信息
     * 
     * @param returnId 退货出库管理主键
     * @return 结果
     */
    @Override
    public int deleteReturnOutboundByReturnId(Long returnId)
    {
        return returnOutboundMapper.deleteReturnOutboundByReturnId(returnId);
    }
}
